package Error;

import java.util.ArrayList;

import Script.Offset;

import interfaces.ErrorReport;

public class OffsetError implements ErrorReport {
	private ArrayList<Offset> offsets;
	private ErrorType type;
	private String message;
	
	public OffsetError(String message, ArrayList<Offset> offsets, 
					   ErrorType type) {
		this.offsets = offsets;
		this.type = type;
		this.message = message;
	}
	
	

	@Override
	public String getErrorMessage() {
		String returnMsg = message;
		
		if (offsets.isEmpty()) {
			return "";
		}
		
		returnMsg += " " + offsets.get(0).getHex(8);
		
		while (offsets.size() > 1) {
			returnMsg += offsets.get(0).getHex(8) + ",";
			offsets.remove(0);
		}
		
		returnMsg += offsets.get(0).getHex(8);
		return returnMsg;
	}

	@Override
	public ErrorType getType() {
		// TODO Auto-generated method stub
		return null;
	}

}
